﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DevOnServer
{
    public class CItemProp
    {
        public int ID;

        public int StackSize;
    }

    public partial class CDataManager
    {
        public Dictionary<int, CItemProp> ItemProperties = new Dictionary<int, CItemProp>();

        private bool _loadPropItem(string filename)
        {
            CFileReader file = new CFileReader();
            if (!file.load(filename))
            {
                CConsole.WriteLine("Can't open item prop file '{0}'", filename);
                return false;
            }

            CItemProp prop;

            string tok;
            while (!file.end)
            {
                file.move(1); // version de l'item

                tok = file.getString();
                if (!m_defines.ContainsKey(tok))
                    continue;

                prop = new CItemProp();

                prop.ID = m_defines[tok];

                file.move(2);

                prop.StackSize = file.getInt();

                file.move(119);

                ItemProperties[prop.ID] = prop;
            }

            return true;
        }
    }
}